import Vue from 'vue'
import VueRouter from 'vue-router'
import discoverMusic from "@/views/discover-music.vue";
import myMusic from "@/views/my-music.vue";
import myInfo from "@/views/my-info.vue";
import product from "@/views/product.vue";
import NotFind from "@/views/NotFind.vue";

Vue.use(VueRouter)
const routes = [
    {
        path: "/",
        redirect: "/discoverMusic",
    },
    {
        path: "/discoverMusic",
        component: discoverMusic,
    },
    {
        path: "/myMusic",
        component: myMusic,
    },
    {
        path: "/myInfo",
        component: myInfo,
    },
    {
        path: "/product/:userId?",
        name: "product",
        component: product,
    },
    {
        path: "*",
        component: NotFind
    }
]
const router = new VueRouter({
    routes,
})

//导出路由对象实例
export default router

